﻿@model ccgstore.WebApp.ViewModels.NewThreadVm

@{
    ViewBag.Title = "NewThread";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create New Thread</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary()
    
    <fieldset>
        <legend>Thread</legend>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Thread.ForumCategoryId, "Category")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(m => m.Thread.ForumCategoryId, new SelectList(Model.ForumCategories, "ForumCategoryId", "Name"))
            @Html.ValidationMessageFor(model => model.Thread.ForumCategoryId)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Thread.Subject, "Subject")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Thread.Subject)
            @Html.ValidationMessageFor(model => model.Thread.Subject)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Post.Content, "Content")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Post.Content)
            @Html.ValidationMessageFor(model => model.Post.Content)
        </div>
   
        <p>
            <input type="submit" value="Create" />
        </p>
    
    </fieldset>
}

@Html.ActionLink("Cancel", "ForumCategories", "Forum")

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}


